package com.rjet.access_control.socket;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author:ethan
 * @Date: 2023/10/12  16:56
 * @Version 1.0.1
 */
//@Component
public class TcpService implements CommandLineRunner {


    @Override
    public void run(String... args) throws Exception {

        System.out.println("tcp start....");

        try {

            new Thread(new Runnable() {
                @Override
                public void run() {

                    TcpServer tcpServer = new TcpServer();
                    tcpServer.tcp();
                }
            }).start();

        }catch (Exception e){
            e.printStackTrace();
        }

    }


}
